<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class ResponseController extends Controller
{
    //响应字符串
    public function str()
    {
        return response('xxx');
       // return response('xxxxxx');
        //return '卡卡 这世界';
    }

    public function tpl()
    {
        return  response()->view('welcome');
        return view('welcome');
    }

    //响应json
    public function json()
    {
        return response()->json(["['name'=>'kaka','age'=>18]","['name'=>'neil']"]);
    }

    //响应下载
    public function download()
    {
        return response()->download('./uploads/meinv.jpg','mm.jpg');
    }
    //响应同时设置cookie
    public function setcookie()
    {
        return response('xxxx')->withCookie('');
    }

    //响应重定向操作
    public function redirect()
    {
        //return redirect('response/json');
        return redirect()->route('ttppll');
    }
    
}
